package hichecker.tools.event.abstract_event;

/**
 * An abstract implementation of a typed event.
 * This implementation stores the event type and provides the method to access it.
 * @author sebastian
 *
 * @param <T> The type of the Events
 */
public abstract class AbstractTypedEvent<T extends Enum<T>> implements TypedEvent<T> {

	private T type;
	
	/**
	 * Constructs an abstract event for the given type.
	 * @param type
	 */
	public AbstractTypedEvent(T type) {
		this.type = type;
	}

	@Deprecated
	public AbstractTypedEvent() {
		// doing nothing
	}
		
	@Override
	public T getEventType() {
		return this.type;
	}
	
	@Override
	public void setEventType(T type) {
		this.type = type;
	}

	@Override
	public String toString() {
		return "AbstractTypedEvent [type=" + this.type + "]";
	}
}
